home *** CD-ROM | disk | FTP | other *** search
- EOSHIFT(3I) Last changed: 1-6-98
-
-
- NNAAMMEE
- EEOOSSHHIIFFTT - Performs an end-off shift on an array expression
-
- SSYYNNOOPPSSIISS
- EEOOSSHHIIFFTT (([AARRRRAAYY==]_a_r_r_a_y,, [SSHHIIFFTT==]_s_h_i_f_t [,,[BBOOUUNNDDAARRYY==]_b_o_u_n_d_a_r_y]
- [,,[DDIIMM==]_d_i_m]))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- Fortran 90
-
- DDEESSCCRRIIPPTTIIOONN
- The EEOOSSHHIIFFTT intrinsic function performs an end-off shift on an array
- expression of rank one, or it performs end-off shifts on all the
- complete rank one sections along a given array expression of rank two
- or greater. Elements are shifted off at one end of a section and
- copies of a boundary value are shifted in at the other end. Different
- sections can have different boundary values and can be shifted by
- different amounts and in different directions; positive for left
- shifts, negative for right shifts.
-
- EEOOSSHHIIFFTT accepts the following arguments:
-
- _a_r_r_a_y May be of any type. It must not be scalar.
-
- _s_h_i_f_t Must be integer. If _a_r_r_a_y has rank one, _s_h_i_f_t must be a
- scalar. Otherwise, _s_h_i_f_t must be scalar or have rank _n-1
- and have
- shape (_d , _d , ..., _d , _d , ..., _d ),
- 1 2 _d_i_m-1 _d_i_m+1 _n
- where (_d , _d , ..., _d )
- 1 2 n
- is the shape of _a_r_r_a_y.
-
- _b_o_u_n_d_a_r_y Must be of the same type and have the same type parameters
- as _a_r_r_a_y. Must be scalar if _a_r_r_a_y has rank one; otherwise,
- it must be either scalar or of rank _n-1 and of
- shape (_d , _d , ..., _d , _d , ..., _d ),
- 1 2 _d_i_m-1 _d_i_m+1 _n
- The _b_o_u_n_d_a_r_y argument can be omitted for the data types in
- the following list. In these cases, the default value is
- the scalar value shown:
-
- TTyyppee ooff _a_r_r_a_y DDeeffaauulltt VVaalluuee ooff _b_o_u_n_d_a_r_y
-
- Integer 0
-
- Real 0.0
-
- Complex (0.0,0.0)
-
- Logical false
-
- Character(_l_e_n) _l_e_n blanks
-
- The _b_o_u_n_d_a_r_y data type must be present for derived data
- types.
-
- _d_i_m Must be a scalar. Must be an integer value in the range
- 1 <= _d_i_m <= _n, where _n is the rank of _a_r_r_a_y. If _d_i_m is
- omitted, the default value is 1.
-
- EEOOSSHHIIFFTT is a transformational intrinsic function. The name of this
- intrinsic cannot be passed as an argument.
-
- RREETTUURRNN VVAALLUUEESS
- The result is an array of the same type, type parameters, and shape as
- _a_r_r_a_y.
-
- Element (_s , _s , ..., _s )
- 1 2 _n
- of the result has the value
- _a_r_r_a_y(_s , _s , ..., _s , _s + _s_h, _s , ..., _s ),
- 1 2 _d_i_m-1 _d_i_m _d_i_m+1 _n
- where _s_h is _s_h_i_f_t or
- _s_h_i_f_t(_s , _s , ..., _s , _s , ..., _s ),
- 1 2 _d_i_m-1 _d_i_m+1 _n
- provided that the inequality
- LLBBOOUUNNDD((_a_r_r_a_y,_d_i_m) <= _s + _s_h <= UUBBOOUUNNDD((_a_r_r_a_y,_d_i_m)
- _d_i_m
- holds and is otherwise _b_o_u_n_d_a_r_y or
- _b_o_u_n_d_a_r_y(_s , _s , ..., _s , _s , ..., _s ).
- 1 2 _d_i_m-1 _d_i_m+1 _n
-
- EEXXAAMMPPLLEESS
- Example 1: If VV is an array [[11,, 22,, 33,, 44,, 55,, 66]], the effect of
- shifting VV end-off to the left by three positions is achieved by
- EEOOSSHHIIFFTT((VV,, SSHHIIFFTT == 33)), which has the value [[44,, 55,, 66,, 00,, 00,, 00]].
- Specifying EEOOSSHHIIFFTT((VV,, SSHHIIFFTT == --22,, BBOOUUNNDDAARRYY == 9999)) achieves an end-off
- shift to the right by two positions with the boundary value of 9999 and
- has the value of [[9999,, 9999,, 11,, 22,, 33,, 44]].
-
- Example 2: The rows of an array of rank two can all be shifted by the
- same amount or by different amounts and the boundary elements can be
- the same or different. Assume that MM is the following array:
-
- | A B C |
-
- | D E F |
-
- | G H I |
-
- The value of EEOOSSHHIIFFTT((MM,, SSHHIIFFTT ==--11,, BBOOUUNNDDAARRYY == ''**'',, DDIIMM == 22)) is as
- follows:
-
- | * A B |
-
- | * D E |
-
- | * G H |
-
- The value of EEOOSSHHIIFFTT((MM,, SSHHIIFFTT ==((// --11,, 11,, 00 //)),, BBOOUUNNDDAARRYY == ((// ''**'',, ''//'',,
- ''??'' //)),, DDIIMM == 22)) is as follows:
-
- | * A B |
-
- | E F / |
-
- | G H I |
-
- The value of section EEOOSSHHIIFFTT((MM((22::33,,22::33)),, SSHHIIFFTT == --11,, BBOOUUNNDDAARRYY == ''**'',,
- DDIIMM==22)) is as follows:
-
- | * E |
-
- | * H |
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
- printed version of this man page.
-
-